<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head> 
        <title>Access page</title>
    </h:head>
    <h:body>
        <!--<ui:include src="../user/menuDialogs.xhtml" />-->
        <p:layout fullPage="true">
            <p:layoutUnit position="west" size="50%">
                <h:form>
                    <p:panel header="Login Form">
                        <h:panelGrid columns="2">
                            <p:outputLabel for="usernameInput" value="Username"/>
                            <p:inputText id="usernameInput" value="#{loginBean2.username}" 
                                         required="true" />
                            <p:outputLabel for="passwordInput" value="Password"/>
                            <p:password id="passwordInput" value="#{loginBean2.password}" 
                                        required="true" />

                            <p:commandButton value="Login" 
                                             action="#{loginBean2.login()}" />
                            <!--<p:commandButton value="Report issue" onclick="PF('issueDialog').show();" />-->
                        </h:panelGrid>
                    </p:panel>
                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="center" size="50%">
                <h:form>
                    <p:panel header="Registration Form">
                        <h:panelGrid columns="3" id="regGrid">
                            <h:outputLabel for="name">Name:</h:outputLabel>
                            <p:inputText id="name" value="#{registrationBean2.user.name}">
                                <p:ajax update="namemsg"/>
                            </p:inputText>
                            <p:message id="namemsg" for="name" />

                            <h:outputLabel for="email">Email:</h:outputLabel>
                            <p:inputText id="email" value="#{registrationBean2.user.email}" >
                                <p:ajax update="emailmsg"/>
                            </p:inputText>
                            <p:message id="emailmsg" for="email" />

                            <h:outputLabel for="password">Password:</h:outputLabel>
                            <p:password id="password" value="#{registrationBean2.user.password}"
                                        feedback="true" match="pwd2" label="Password"/>
                            <p:message for="password" />

                            <h:outputLabel for="pwd2">Confirm Password:</h:outputLabel>
                            <p:password id="pwd2" label="Confirm Password"/>

                            <p:spacer/>

                            <p:outputLabel id ="inputLoc" value="Location" for="province" />
                            <p:autoComplete id="province" dropdown="true" value="#{autoCompleteView.province}" 
                                            completeMethod="#{autoCompleteView.completeText}" />
                        </h:panelGrid>
                        <p:growl id="msgs" showDetail="true" />
                        <p:commandButton value="Register" 
                                         action="#{registrationBean2.register()}" />
                    </p:panel>
                </h:form>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>

